<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <input type="text" v-model="num"  v-on:keyup.up="num+=2" @keyup.down="num-=2" @click.ctrl="num=10"/>
      <button v-on:click="num++">点赞</button>
      <button @click="cancel">取消</button>
      <h1> vue 您好。有{{num}}人都说vue功能强悍，给你点赞！</h1>

      <div style="border: 1px solid red; padding: 40px;" v-on:click="hello">
        <div style="border: 1px solid blue; padding: 20px;" @click.stop="hello">

        </div>
      </div>
    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>

    <script>
      let vm = new Vue({
        el: "#app",
        data: {
          num: 1,
        },
        methods: {
          cancel(){
            this.num--;
          },

          hello(){
            alert("点击了");
          }
        },
      });
    </script>
  </body>
</html>
